package com.hut.oa.model.bean;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

/**
 * 出差申请表
 * @author ksice
 *
 */
@Entity
@Table(name="apply_business")
public class ApplyBusiness {
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name="ab_id",nullable=false)
	private Long id;//出差申请表id
	
	@Column(name="ab_address",nullable=false)
	private String address;//出差地点
	
	@Column(name="ab_go_time",nullable=false)
	private Date gotime;//出差时间
	
	@Column(name="ab_back_time",nullable=false)
	private Date backtime;//返回时间
	
	@Column(name="ab_content",nullable=false)
	private String content;//出差事项
	
	@Column(name="ab_money",nullable=false)
	private Double money;//出差预算
	
	@JoinColumn(name="ab_apply_id",nullable=false)
	@OneToOne(cascade=CascadeType.ALL)
	private Apply apply;//通用申请

	public ApplyBusiness() {}
	
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public Date getGotime() {
		return gotime;
	}

	public void setGotime(Date gotime) {
		this.gotime = gotime;
	}

	public Date getBacktime() {
		return backtime;
	}

	public void setBacktime(Date backtime) {
		this.backtime = backtime;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public Double getMoney() {
		return money;
	}

	public void setMoney(Double money) {
		this.money = money;
	}

	public Apply getApply() {
		return apply;
	}

	public void setApply(Apply apply) {
		this.apply = apply;
	}

	@Override
	public String toString() {
		return "ApplyBusiness [id=" + id + ", address=" + address + ", gotime=" + gotime + ", backtime=" + backtime
				+ ", content=" + content + ", money=" + money + "]";
	}
	
}
